getaddrinfo-is-threadsafe
authorDebian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>
Mon, 17 Apr 2017 03:10:43 +0000 (03:10 +0000)
committerRyan Tandy <ryan@nardis.ca>
Mon, 17 Apr 2017 03:10:43 +0000 (03:10 +0000)
commit51eb28d10ad34c7808f12d7b24b72f821e5b0c0b
treefa71426b0b0f9c045fb3d6a44c12ccd86b3a4696
parentd0984a16a34cdf02288806c66a03a18db90e6931
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c